package ar.edu.utn.frgp.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ar.edu.utn.frgp.servicio.ClienteService;


public class ClientesSuccessServlet extends GenericServlet {

	private ClienteService cliService;
	
	public ClientesSuccessServlet(){
		super();
		cliService = new ClienteService();

	}

	@Override
	public void doAction(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
		String dni = request.getParameter("dni");
		String apellido = request.getParameter("apellido");
		String nombre = request.getParameter("nombre");
		
		cliService.addCliente(dni, apellido, nombre);
		
		response.sendRedirect(request.getContextPath() + "/clientes");
	}	
}
